<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
<link href="style/store.css" rel="stylesheet" type="text/css">
<link href="style/displaytagex.css" rel="stylesheet" type="text/css">

</head>
<body>
<s:form name="formName" method="post" >
	<s:hidden name="customers.customer_id" />
	<s:hidden name="customers.date_registered" />
	<s:hidden name="customers.last_transaction_date" />
	<s:hidden name="customers.accumulated_price" />
	<s:hidden name="dispMode" />
	
	<table align="center">
		<tr>
			<td>
				<span class="error" >
					<s:actionerror/>
					<s:actionmessage/>
				</span>
			</td>
		</tr>
	</table>
<s:if test="#request.dispMode == 1 ">
	<table align="center" width="100%">
		<tr>
			<td class="verdana" height="30" align="center" bgcolor="#336699">
				<font color="#ffffff">Customer Information Maintenance</font>
			</td>
		</tr>
	</table>
	<table align="center">
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Please enter Suki Card Number: </label></td>
			<td><s:textfield name="searchSukiNo" /></td>
			<td><s:submit value="Search" action="searchCustomerAction" cssClass="button" />
		</tr>
	</table>
	<center>
	<s:set name="customerList" value="customerList" scope="request"></s:set>
	<display:table name="customerList" uid="row" pagesize="10" class="dataTable"
	requestURI="goToCustomerMaintenance.action">
		<display:column property="customer_id" title="ID"></display:column>
		<display:column property="firstname" title="First Name"></display:column>
		<display:column property="lastname" title="Last Name"></display:column>
		<display:column property="date_registered" title="Date Registered"></display:column>
		<display:column property="suki_card_no" title="Suki Card Number"></display:column>
		<display:column>
			<s:url id="update" action="goToUpdateCustomerAction">
						<s:param name="customers.customer_id" value="#attr.row.customer_id"></s:param>
					</s:url>
					<s:a href="%{update}">Update</s:a>
					&nbsp; | &nbsp;
					<s:url id="delete" action="deleteCustomerAction">
						<s:param name="customers.customer_id" value="#attr.row.customer_id"></s:param>
					</s:url>
					<s:a href="%{delete}" onclick="return confirm('Are you sure?')" >Delete</s:a>
		</display:column>
		<display:setProperty name="paging.banner.placement" value="bottom" />
	</display:table>
	</center>
	<table>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><s:submit value="Add Customer" action="goToAddCustomerAction" cssClass="button" /></td>
		</tr>
	</table>
</s:if>
<s:if test="#request.dispMode == 2 ">
	<table align="center" width="60%">
		<tr>
			<td colspan="2" class="verdana" height="30" align="center" bgcolor="#336699">
				<font color="#ffffff">Add Customer</font>
			</td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>First Name: </label></td>
			<td><s:textfield name="customers.firstname" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Last Name: </label></td>
			<td><s:textfield name="customers.lastname" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Middle Name: </label></td>
			<td><s:textfield name="customers.middlename" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Address: </label></td>
			<td><s:textfield name="customers.address" size="55"/></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Email: </label></td>
			<td><s:textfield name="customers.email"/></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Telephone: </label></td>
			<td><s:textfield name="customers.telephone" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Cell Phone: </label></td>
			<td><s:textfield name="customers.cellphone" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Suki Card Number: </label></td>
			<td><s:textfield name="customers.suki_card_no" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td colspan="2" align="center" >
				<s:submit value="Add Customer" action="doAddCustomerAction" cssClass="button" />
				&nbsp;&nbsp;
				<s:submit value="Cancel" action="goToCustomerMaintenance" cssClass="button" />
			</td>
		</tr>
	</table>
</s:if>

<s:if test="#request.dispMode == 3 ">
		<table align="center" width="60%">
		<tr>
			<td colspan="2" class="verdana" height="30" align="center" bgcolor="#336699">
				<font color="#ffffff">Update Customer</font>
			</td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>First Name: </label></td>
			<td><s:textfield name="customers.firstname" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Last Name: </label></td>
			<td><s:textfield name="customers.lastname" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Middle Name: </label></td>
			<td><s:textfield name="customers.middlename" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Address: </label></td>
			<td><s:textfield name="customers.address" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Email: </label></td>
			<td><s:textfield name="customers.email" size="55" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Telephone: </label></td>
			<td><s:textfield name="customers.telephone" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Cell Phone: </label></td>
			<td><s:textfield name="customers.cellphone" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td><label>Suki Card Number: </label></td>
			<td><s:textfield name="customers.suki_card_no" /></td>
		</tr>
		<tr bgcolor="#e8ecf0" style="font-size: 11px; font-family: Arial, Helvetica, sans-serif" >
			<td colspan="2" align="center" >
				<s:submit value="Update Customer" action="doUpdateCustomerAction" cssClass="button" />
				&nbsp;&nbsp;
				<s:submit value="Cancel" action="goToCustomerMaintenance" cssClass="button" />
			</td>
		</tr>
	</table>
</s:if>
</s:form>
</body>
</html>